package com.neuronbit.businessflow.intellij.model;


import com.neuronbit.businessflow.intellij.model.annotation.HiddenProperty;

import java.io.Serializable;

/**
 * The type Java method task.
 */
public abstract class JavaMethodTask extends Task implements Serializable {
    private Call callable = new Call();
    private ExceptionHandler exceptionHandler = new ExceptionHandler();

    /**
     * Instantiates a new Java method task.
     *
     * @param id       the id
     * @param name     the name
     * @param nodeType the node type
     */
    public JavaMethodTask(String id, String name, NodeType nodeType) {
        super(id, name, nodeType);
    }

    /**
     * Sets callable.
     *
     * @param callable the callable
     */
    @HiddenProperty
    public void setCallable(Call callable) {
        this.callable = callable;
    }

    /**
     * Gets callable.
     *
     * @return the callable
     */
    public Call getCallable() {
        return callable;
    }

    /**
     * Gets exception handler.
     *
     * @return the exception handler
     */
    public ExceptionHandler getExceptionHandler() {
        return exceptionHandler;
    }

    /**
     * Sets exception handler.
     *
     * @param exceptionHandler the exception handler
     */
    @HiddenProperty
    public void setExceptionHandler(ExceptionHandler exceptionHandler) {
        this.exceptionHandler = exceptionHandler;
    }
}
